﻿ using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.Security;
using StudentHookups.WCF;
using System.Web.UI.WebControls;

namespace StudentHookups
{
    public partial class SiteMaster : System.Web.UI.MasterPage
    {
        Label lblAmountmsg = new Label();
        
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.IsAuthenticated)
            {
                WCFClient client = new WCFClient();

                //Displays number of incoming messages for one user
                lblAmountmsg = (Label)HeadLoginView.FindControl("lblAmountmsg");
                lblAmountmsg.Text = client.messageAmount((Guid)Membership.GetUser().ProviderUserKey).ToString();
            }
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/SearchResults.aspx?" + ddlsearchpara.SelectedValue + "=" +tbSearch.Text);
        }
    }
}
